package com.wuyan.locationdog.adapter

import androidx.annotation.LayoutRes
import com.arcsoft.commonbase.bean.ProvinceBeanContent
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wuyan.locationdog.R


class FenceProvinceAdapter(var isProvince: Boolean, @LayoutRes layoutResId: Int, data: MutableList<ProvinceBeanContent>?) :
    BaseQuickAdapter<ProvinceBeanContent, BaseViewHolder>(layoutResId, data) {

    override fun convert(holder: BaseViewHolder, item: ProvinceBeanContent) {
        if (isProvince) {
            holder.setText(R.id.name, item.provinceName)
        } else {
            holder.setText(R.id.name, item.cityName)
        }

        if (item.isSelect) {
            holder.setVisible(R.id.iv_select, true)
            holder.setTextColorRes(R.id.name, com.arcsoft.commonbase.R.color.text_color_selected)
        } else {
            holder.setGone(R.id.iv_select, true)
            holder.setTextColorRes(R.id.name, com.arcsoft.commonbase.R.color.color_3)
        }
    }

}

